/*
########################################################################
#                                                                      # 
# Written by Andreas Marschke E-Mail:xxtjaxx@gmail.com or AnMa9@gmx.de #
#                                                                      #
# This program is free software; you can redistribute it and/or modify #
#                                                                      #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or    #
# (at your option) any later version.                                  #
#                                                                      # 
# This program is distributed in the hope that it will be useful,      #
# but WITHOUT ANY WARRANTY; without even the implied warranty of       #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        #
# GNU General Public License for more details.                         #
#                                                                      #
# You should have received a copy of the GNU General Public License    #
# along with this program; if not, write to the Free Software          # 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,           #
# MA 02110-1301, USA.                                                  #
#                                                                      #
######################################################################## 
*/



/*
########################################################################
#                                                                      #
# This method is the essential part of the trick. The most             #
# it does is reading out the chars from the pointer and put            #
# them into the desired form of datatype(string).                      #
#                                                                      #
########################################################################
*/

#include<iostream>
#include<string>

using std::string;
using namespace std;

/*
  option_input_analysis(char*):
      this function is internally supposed to read out the pointer and 
      convert it to a string so that it can be compared to a char.
      After that it should return one of our codes we set here so 
      that another function can check for validity and react on that.

  This step is important as the switch statemnet in the main-function 
  only accepts single chars for its comparrision.
*/

char option_input_analysis(char* input)
{
  /*converting the char* into the string*/
  string _input(input);
  
  /*check if it matches to a desired pattern*/
  if( _input == "--help")
    {
      /*return a meaningful abstraction of what it is*/
      return 'h'; 
    }
  else if ( _input == "-h" )
    {
      return 'h';
    }
  else if ( _input == "--version" )
    {
      return 'v';
    }
  else if ( _input == "-v" )
    {
      return 'v';
    }
  else if ( _input == "" )
    {
      return 'h';
    }
  else
    {
      return 'E';
    }
}
